package o;

import android.os.Handler;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.ExoPlaybackException;

public final class abn {
    private boolean ʻ;
    private Handler ʼ;
    private boolean ʽ = true;
    private int ˊ;
    private boolean ˊॱ;
    private final c ˋ;
    private boolean ˋॱ;
    private final a ˎ;
    @Nullable
    private Object ˏ;
    private boolean ˏॱ;
    private final abr ॱ;
    private int ॱॱ;
    private long ᐝ = -9223372036854775807L;

    public interface c {
        void ˎ(int i, @Nullable Object obj) throws ExoPlaybackException;
    }

    public interface a {
        void ˏ(abn o_abn);
    }

    public abn(a aVar, c cVar, abr o_abr, int i, Handler handler) {
        this.ˎ = aVar;
        this.ˋ = cVar;
        this.ॱ = o_abr;
        this.ʼ = handler;
        this.ॱॱ = i;
    }

    public abr ॱ() {
        return this.ॱ;
    }

    public c ˋ() {
        return this.ˋ;
    }

    public abn ॱ(int i) {
        amm.ˏ(!this.ʻ);
        this.ˊ = i;
        return this;
    }

    public int ˏ() {
        return this.ˊ;
    }

    public abn ˏ(@Nullable Object obj) {
        amm.ˏ(!this.ʻ);
        this.ˏ = obj;
        return this;
    }

    @Nullable
    public Object ˊ() {
        return this.ˏ;
    }

    public Handler ˎ() {
        return this.ʼ;
    }

    public long ʼ() {
        return this.ᐝ;
    }

    public int ʻ() {
        return this.ॱॱ;
    }

    public boolean ʽ() {
        return this.ʽ;
    }

    public abn ॱॱ() {
        amm.ˏ(!this.ʻ);
        if (this.ᐝ == -9223372036854775807L) {
            amm.ˊ(this.ʽ);
        }
        this.ʻ = true;
        this.ˎ.ˏ(this);
        return this;
    }

    public synchronized boolean ᐝ() {
        return this.ˊॱ;
    }

    public synchronized boolean ˏॱ() throws InterruptedException {
        amm.ˏ(this.ʻ);
        amm.ˏ(this.ʼ.getLooper().getThread() != Thread.currentThread());
        while (!this.ˏॱ) {
            wait();
        }
        return this.ˋॱ;
    }

    public synchronized void ˊ(boolean z) {
        this.ˋॱ |= z;
        this.ˏॱ = true;
        notifyAll();
    }
}
